Redeeming a gift card
Details
URL : <base_url>/giftcards/redeem/{gift_card_code}
Method : POST
Authentication required : YES
Post body type: Form Data
Request parameters
In the request URL, provide the following parameters in the body of the request.
Parameter | Type | Example | Description | |
---|---|---|---|---|
amount | numeric | 99.99 | Amount to redeem, can be null if type id full. | |
type | string | partial or full | Tells the system how to redeem this gift card. | |
reference_number | string | 773737ASDD | nullable | Assigns a reference number at redemption time. |
cashier_pin | integer | 12345 | Pin of the current cashier | |
card_pin | integer | 12345 | Only required if pin_required attribute is true |
Success Response
Code : 200 OK
Content :
{
"success": true,
"has_reference_number": true,
"activity_id": 123
}
{
"success": true,
"has_reference_number": false,
"activity_id": 123
}
Error Responses
Condition : Incorrect code.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"code": "The provided code is incorrect"
}
}
Condition : no balance.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"amount": "gift card with code XXXXXX has no balance"
}
}
Condition : Amount too large.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"amount": "Please enter an amount less than or equal to 950"
}
}
Condition : Inactive.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"code": "Inactive gift card with code: XXXXX"
}
}
Condition : expired.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"code": "Expired gift card with code: XXXXX"
}
}